Returns or sets a value that determines if the query should be prepared using the SQLPrepare or SQLExecDirect ODBC API function.
Syntax
object.Prepared [= value]
The Prepared property syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
value | A Boolean expression as described in Settings. |
Settings
The Prepared property has these settings:
Setting | Description |
True | The statement is prepared. (Default) |
False | The statement is not prepared. |
Remarks
By default the Prepared property is True. However, you can set this property to False to prohibit "preparation" of the query. In this case, the query is executed using the SQLExecDirect API.
When the ODBC interface submits a query to the remote server, it either submits the query directly to the server, or creates a stored procedure to perform the operation. Creating a stored procedure can slow down the initial operation, but increases performance of all subsequent references to the query. However, some queries cannot be executed in the form of stored procedures. In these cases, you must set the Prepare property to False.